.TH quotacheck 8 "Fri Jul 20 2001"
.SH NAME
quotacheck \- scan a filesystem for disk usage, create, check and repair quota files
.SH SYNOPSIS
.B quotacheck
[
.B \-gubcfinvdMmR
] [
.B \-F
.I quota-format
]
.B \-a
|
.I filesystem
.br
.SH DESCRIPTION
.B quotacheck
examines each filesystem, builds a table of current disk usage, and
compares this table against that recorded in the disk quota file for the
filesystem (this step is omitted if option
.B -c
is specified). If any inconsistencies are detected, both the quota file
and the current system copy of the incorrect quotas are updated (the
latter only occurs if an active filesystem is checked which is not advised).
By default, only user quotas are checked.
.B quotacheck
expects each filesystem to be checked to have quota files named
.I [a]quota.user
and
.I [a]quota.group
located at the root of the associated filesystem.  If a file is not
present, 
.B quotacheck
will create it.
.PP
If the quota file is corrupted,
.B quotacheck
tries to save as much data as possible.  Rescuing data may need user
intervention. With no additional options
.B quotacheck
will simply exit in such a situation. When in interactive mode (option
.BR -i )
, the user is asked for advice. Advice can also be provided from command
line (see option
.BR -n )
, which is useful when
.B quotacheck
is run automatically (ie. from script) and failure is unacceptable.
.PP
.B quotacheck
should be run each time the system boots and mounts non-valid filesystems.
This is most likely to happen after a system crash.
.PP
It is strongly recommended to run
.B quotacheck
with quotas turned off for the filesystem. Otherwise, possible damage
or loss to data in the quota files can result.  It is also unwise to
run
.B quotacheck
on a live filesystem as actual usage may change during the scan.  To
prevent this,
.B quotacheck
tries to remount the filesystem read-only before starting the scan.  
After the scan is done it remounts the filesystem read-write. You can
disable this with option
.BR \-m .
You can also make
.B quotacheck
ignore the failure to remount the filesystem read-only with option
.BR \-M .
.SH OPTIONS
.TP
.B -b, --backup
Forces
.B quotacheck
to make backups of the quota file before writing the new data.
.TP
.B -v, --verbose
.B quotacheck
reports its operation as it progresses.  Normally it operates silently.
If the option is specified twice, also the current directory is printed (note
that printing can slow down the scan measurably).
.TP
.B -d, --debug
Enable debugging mode.  It will result in a lot of information which can
be used in debugging the program. The output is very verbose and the
scan will be slow.
.TP
.B -u, --user
Only user quotas listed in
.I /etc/mtab
or on the filesystems specified are to be checked.  This is the default action.
.TP
.B -g, --group
Only group quotas listed in
.I /etc/mtab
or on the filesystems specified are to be checked.
.TP
.B -c, --create-files
Don't read existing quota files. Just perform a new scan and save it to disk.
.B quotacheck
also skips scanning of old quota files when they are not found.
.TP
.B -f, --force
Forces checking and writing of new quota files on filesystems with quotas
enabled. This is not recommended as the created quota files may be out of sync.
.TP
.B -M, --try-remount
This flag forces checking of filesystem in read-write mode if a remount
fails. Do this only when you are sure no process will write to a
filesystem while scanning.
.TP
.B -m, --no-remount
Don't try to remount filesystem read-only. See comment with option
.BR \-M .
.TP
.B -i, --interactive
Interactive mode. By default
.B quotacheck
exits when it finds an error. In interactive mode user is asked for
input instead.  See option
.BR \-n .
.TP
.B -n, --use-first-dquot
If the quota files become corrupted, it is possible for duplicate
entries for a single user or group ID to exist.  Normally in this case,
.B quotacheck
exits or asks user for input. When this option is set, the first entry found
is always used (this option works in interactive mode too).
.TP
.B -F, --format=\f2format-name\f1
Check and fix quota files of specified format (ie. don't perform format
auto-detection). This is recommended as detection might not work well on
corrupted quota files.  Possible format names are:
.B vfsold
Original quota format with 16-bit UIDs / GIDs,
.B vfsv0
Quota format with 32-bit UIDs / GIDs, 64-bit space usage, 32-bit inode usage and limits,
.B vfsv1
Quota format with 64-bit quota limits and usage,
.B rpc
(quota over NFS),
.B xfs
(quota on XFS filesystem)
.TP
.B -a, --all
Check all mounted non-NFS filesystems in
.B /etc/mtab
.TP
.B -R, --exclude-root
When used together with the
.B \-a
option, all filesystems except for the root filesystem are checked for
quotas.

.SH NOTE
.B quotacheck
should only be run by super-user. Non-privileged users are presumably
not allowed to read all the directories on the given filesystem.

.SH "SEE ALSO"
.BR quota (1),
.BR quotactl (2),
.BR fstab (5),
.BR quotaon (8),
.BR repquota (8),
.BR convertquota (8),
.BR setquota (8),
.BR edquota (8),
.BR fsck (8),
.BR efsck (8),
.BR e2fsck (8),
.BR xfsck (8)

.SH FILES
.PD 0
.TP 15
.B aquota.user or aquota.group
located at filesystem root with quotas (version 2 quota, non-XFS
filesystems)
.TP 15
.B quota.user or quota.group
located at filesystem root with quotas (version 1 quota, non-XFS
filesystems)
.TP
.B /etc/mtab
names and locations of mounted filesystems
.SH AUTHOR
Jan Kara \<jack@suse.cz\>
.br
Based on old
.B quotacheck
by:
.br
Edvard Tuinder \<ed@elm.net\>
.br
Marco van Wieringen \<mvw@planets.elm.net\>
